package com.bajie.bjlisten.entity.response;

import lombok.ToString;


@ToString
public enum CommonCode implements ResultCode {

    INVALIDPARAM(false, 10003, "请输入手机号码"),
    SUCCESS(true, 10000, "操作成功！"),
    FAIL(false, 11111, "操作失败！"),
    UNAUTHENTICATED(false, 10001, "此操作需要登陆系统！"),
    UNAUTHORISE(false, 10002, "权限不足，无权操作！"),
    SERVER_ERROR(false, 99999, "抱歉，系统繁忙，请稍后重试！"),
    USERNAME_ISEXIST(false, 33333, "用户名已存在"),
    PHONE_ISEXIST(false, 44444, "该手机号码已注册"),
    PARAM_ISNULL(false, 22222, "用户名或密码不能为空"),
    CAPTCHA_ISNULL(false, 55555, "请输入手机验证码"),
    BJUSERS_PARENTID_OR_ID_ISNULL(false, 77777, "输入id或者pid有误"),
    BJUSERS_PARAMS_ERROR(false, 88888, "获取用户金币参数有误"),
    BJUSERS_ISNULL(false, 11112, "用户不存在"),
    DISTRIBUTION_ISNULL(false, 66666, "用户输入邀请码不存在"),
    PHONENUMBER_ISNULL(false,677777,"请输入正确的手机号");
    //    private static ImmutableMap<Integer, CommonCode> codes ;
    //操作是否成功
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;

    private CommonCode(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }


}
